package com.chen.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static io.lettuce.core.pubsub.PubSubOutput.Type.message;

/**
 * <p>
 *
 * </p>
 *
 * @author personcoder007
 * @since 2022-08-16
 */
@Getter
@Setter
@ApiModel(value = "Question对象", description = "")
public class Question implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键自增")
    @TableId(value = "id", type = IdType.AUTO)
//    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ExcelProperty(value = "ID")
    private Integer id;

    @ApiModelProperty("名称")
    @ExcelProperty(value = "题目名称")
    @NotEmpty(
            message="题目不能为空"
    )
    @Length( min = 2,
            max = 200,
            message = "题目长度在2,200之间")
    private String name;

    @ApiModelProperty("类型 1 选择 2判断 3 问答")
    @ExcelProperty(value = "题目类型")
    @NotNull(
            message = "删除标记不能为空"
    )
    private Integer type;

    @ApiModelProperty("a选项")
    @ExcelProperty(value = "a选项")
    private String a;

    @ApiModelProperty("b选项")
    @ExcelProperty(value = "b选项")
    private String b;

    @ApiModelProperty("c选项")
    @ExcelProperty(value = "c选项")
    private String c;

    @ApiModelProperty("d选项")
    @ExcelProperty(value = "d选项")
    private String d;

    @ApiModelProperty("分数")
    @ExcelProperty(value = "分值")
    private Integer score;

    @ApiModelProperty("出题人id")
    private Integer userId;

    @ExcelProperty(value = "操作时间")
    @ApiModelProperty("时间")
    private Date time;

    @ApiModelProperty("答案")
    @ExcelProperty(value = "答案")
    private String answer;

    @ApiModelProperty("解析")
    @ExcelProperty(value = "解析")
    private String detail;

    @ApiModelProperty("课程id")
    @TableField("course_id")
    @ExcelProperty(value = "课程id")
    private Integer courseId;


    @ApiModelProperty("课程")
    @TableField(exist = false)
    private String course;

    @ApiModelProperty("用户名")
    @TableField(exist = false)
    private String userName;

    @ApiModelProperty("类型")
    @TableField(exist = false)
    private String questionType;

    @ApiModelProperty("所属课程")
    @TableField(exist = false)
    private String courseName;


}
